﻿using SqlSugar.Extensions;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Zhao.Common.Helper;
using Zhao.Models.AppletDto;
using Zhao.Models.DTO;
using Zhao.Models.Entity;

namespace Zhao.IServer
{
    /// <summary>
    /// 订单表（支付凭证）
    ///</summary>
    public interface IOrdersServer : IBaseService<Orders>
    {
        public Task<PageModel<OrderDTO>> QueryOrderPage(Expression<Func<Orders, Users, bool>> expression, int pageIndex, int pageSize);


        #region 小程序端API
        /// <summary>
        /// 获取用户账单详情
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="expression"></param>
        /// <returns></returns>
        public Task<PageModel<OrderByUserIdInfoDto>> GetUserOrderAsync(int pageIndex, int pageSize, Expression<Func<Orders, bool>> expression);

        /// <summary>
        /// 场馆预约订单的账单详情信息
        /// 获取订单详情（包含退款信息）
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="orderId">订单ID</param>
        /// <returns>订单详情</returns>
        public Task<ApiResult<OrderDetailDto>> GetOrderDetail(int userId, int orderId);

        /// <summary>
        /// 获取活动订单详情
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="orderId">订单ID</param>
        /// <returns>活动订单详情</returns>
        public Task<ApiResult<ActivityOrderDetailDto>> GetActivityOrderDetail(int userId, int orderId);
        #endregion
    }
}
